-- **** DON'T FORGET TO MOVE THE FILES() AND FILENAME() XFCNs SO
-- THAT THEY WILL BE AVAILABLE TO THE SCRIPT.
-- USE RESEDIT OR RESCOPY FOR THIS.
if the optionkey is down then pass mouseup
put the userlevel into Oldlevel
put FileName("STAK") into compacterPath
go to this card -- redraws card
--use the 2 lines below to create a default pathname if desired.
--if compacterPath is empty then put "Mydisk:Lotsa Stacks" into --compacterPath
if compacterPath is empty then
exit to hypercard
end if
put FolderPath(compacterPath) into compacterPath
if compacterPath is empty then
answer "Problems with this folder name" with "Too bad"
exit to hypercard
end if
Put Files(compacterPath,"STAK") into stacknames
push card
put zero into examined
put zero into compacted
put zero into saved
set the cursor to 4 -- it is the watch
set lockmessages to true
set lockscreen to true
repeat with x = 1 to number of lines of stacknames
if the shiftKey is down then
put "Checking halted" into msg
set the userlevel to Oldlevel
set lockmessages to false
set lockscreen to false
exit mouseup
end if
put line x of stacknames into thisstack
put "Checking " & quote & thisstack & quote
add one to examined
put the freesize of stack thisstack into fsize
put " -- Freesize is" && fsize after msg
if fsize is zero then
wait 30
else
go to stack thisstack
set the userlevel to 3
if the userlevel > 2 then
put "Compacting" into first word of msg
add fsize to saved
doMenu "Compact Stack"
add one to compacted
end if
end if
end repeat
pop card
set lockmessages to false
set lockscreen to false
Put "All done!" && "Examined" && examined && "stacks; compacted" && compacted &&"to regain" && saved && "bytes."
wait 3 seconds
hide msg
set the userlevel to Oldlevel
end mouseUp
-- part contents for background part 12
----- text -----
massCompact
-- part contents for card part 1
----- text -----
This button allows you to select a stack from a folder and automatically compacts all the stacks with wasted space in the same folder. If you copy this button to another stack, you also need to install the Filename & Files XFCNs.